#include "Triangle.h"
namespace sffs {

// Constructor()
Triangle::Triangle()
{
	m_Shape.AddPoint(0.0f, 0.0f, m_Color, sf::Color(0,0,0)) ;
	m_Shape.AddPoint(0.0f, 0.0f, m_Color, sf::Color(0,0,0)) ;
	m_Shape.AddPoint(0.0f, 0.0f, m_Color, sf::Color(0,0,0)) ;
	m_Shape.EnableFill(true) ;
	m_Shape.SetColor(m_Color) ;
	m_Shape.EnableOutline(true) ;
	m_Shape.SetOutlineWidth(0.0f) ;
}

// Constructor(pair<float,float>, pair<float,float>, pair<float,float>, sf::Color)
Triangle::Triangle(const std::pair<float, float>& _Corner0, const std::pair<float, float>& _Corner1, const std::pair<float, float>& _Corner2, const sf::Color& _Color)
	: m_Color(_Color)
{
	m_Shape.AddPoint(_Corner0.first, _Corner0.second, _Color, sf::Color(0,0,0)) ;
	m_Shape.AddPoint(_Corner1.first, _Corner1.second, _Color, sf::Color(0,0,0)) ;
	m_Shape.AddPoint(_Corner2.first, _Corner2.second, _Color, sf::Color(0,0,0)) ;
	m_Shape.EnableFill(true) ;
	m_Shape.SetColor(m_Color) ;
	m_Shape.EnableOutline(true) ;
	m_Shape.SetOutlineWidth(0.0f) ;
}

// Destructor
Triangle::~Triangle()
{
}

// SetColor
void Triangle::SetColor(int _R, int _G, int _B)
{
	m_Color = sf::Color(_R, _G, _B) ;
	m_Shape.SetColor(m_Color) ;
	m_Shape.SetPointColor(0, m_Color) ;
	m_Shape.SetPointColor(1, m_Color) ;
	m_Shape.SetPointColor(2, m_Color) ;
}

// Draw
void Triangle::Draw() const
{
	Triangle::m_Window->Draw(m_Shape) ;
}

void Triangle::ChangeColor(int newTime)
{

}

} // namespace sffs